Add User Settings for Celebrating Completed Issues and Refactor User Formatting #27
+230
−94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
enhancement, bug_fix
Description
settings
JSONB column to theusers
table to store user preferences.formatUserForGraphql
helper function to standardize user object formatting across different resolvers.dev:migrate
inpackage.json
for running database migrations.js-confetti
andreact-canvas-confetti
for implementing confetti effects.Changes walkthrough
18 files
resolvers-types.ts
backend/src/__generated__/resolvers-types.ts
Added
settings
field toUpdateMeInput
andUser
types.20240112143058-add-settings-to-user.ts
backend/src/db/migrations/20240112143058-add-settings-to-user.ts
Created a migration to add a
settings
JSONB column to theusers
table.types.ts
backend/src/db/models/types.ts
Added
settings
attribute to theUser
class to supportJSONB type.
user.ts
backend/src/db/models/user.ts
Defined
settings
field of typeJSONB
in the user model.index.ts
backend/src/resolvers/issue/index.ts
Refactored to use
formatUserForGraphql
helper function forreporter
andassignee
fields.index.ts
backend/src/resolvers/project/index.ts
Refactored to use
formatUserForGraphql
helper function forusers
field.helpers.ts
backend/src/resolvers/user/helpers.ts
Created
formatUserForGraphql
helper function to formatuser data for GraphQL responses.
index.ts
backend/src/resolvers/user/index.ts
Refactored user resolvers to use
formatUserForGraphql
helper function and added
settings
handling inupdateMe
mutation.
type-defs.ts
backend/src/type-defs.ts
Added
settings
field to GraphQL schema forUser
type andUpdateMeInput
.page.tsx
frontend/app/profile/page.tsx
Updated profile page with style adjustments and removed
unused username field.
UploadComponent.tsx
frontend/components/Avatar/UploadComponent.tsx
Updated avatar upload component with style adjustments and
added label style prop.
DropdownUser.tsx
frontend/components/Header/DropdownUser.tsx
Updated user dropdown component with style adjustments and
commented out settings link.
index.tsx
frontend/components/KanbanBoard/index.tsx
Integrated confetti effects for completed issues and added
user settings check for enabling the feature.
UserInfo.tsx
frontend/components/Profile/UserInfo.tsx
Added user settings form with a toggle for enabling
celebration on issue completion.
graphql.ts
frontend/gql/__generated__/graphql.ts
Updated generated GraphQL types to include
settings
field.gql-queries-mutations.ts
frontend/gql/gql-queries-mutations.ts
Added
settings
field toUSER_FIELDS
fragment.package.json
backend/package.json
Added a new script
dev:migrate
for database migrations.package.json
frontend/package.json
Added
js-confetti
andreact-canvas-confetti
packages forconfetti effects.
1 files
fastify-hooks.ts
backend/src/server/fastify-hooks.ts
Updated
addUserToRequest
to correctly type cast cacheduser.
1 files
pnpm-lock.yaml
frontend/pnpm-lock.yaml
Updated lock file with new dependencies for confetti
effects.
✨ Usage guide:
Overview:
The
describe
tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.When commenting, to edit configurations related to the describe tool (
pr_description
section), use the following template:With a configuration file, use the following template:
Enabling\disabling automation
meaning the
describe
tool will run automatically on every PR, will keep the original title, and will add the original user description above the generated description.the tool will replace every marker of the form
pr_agent:marker_name
in the PR description with the relevant content, wheremarker_name
is one of the following:type
: the PR type.summary
: the PR summary.walkthrough
: the PR walkthrough.Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.
Custom labels
The default labels of the
describe
tool are quite generic: [Bug fix
,Tests
,Enhancement
,Documentation
,Other
].If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:
Main topic:performance
- pr_agent:The main topic of this PR is performanceNew endpoint
- pr_agent:A new endpoint was added in this PRSQL query
- pr_agent:A new SQL query was added in this PRDockerfile changes
- pr_agent:The PR contains changes in the DockerfileThe list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.
Utilizing extra instructions
The
describe
tool can be configured with extra instructions, to guide the model to a feedback tailored to the needs of your project.Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is fixed, and cannot be changed. Extra instructions can change the content or style of each sub-section of the PR description.
Examples for extra instructions:
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
More PR-Agent commands
See the describe usage page for a comprehensive guide on using this tool.